<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2017/5/22
  Time: 9:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags" %>
<html>
<head>
    <jsp:include page="../../head.jsp"/>
    <title>查验不通过统计</title>
    <script type="text/javascript">
        var formSetting = {
                title: "查询信息",
                module: 'query',
                columns: [
                    {
                        name: "supplier",
                        label: "业务供应商",
                        type: "dropdown",
                        dropdownType: "ajax",
                        url: "<s:url value='/order-dropdown/supCompanyByKey'/>",
                        op: "eq",
                        minLength: 1,
                        keyWordName: "key",
                        success: function (data) {
                            data = data.results;
                            var array = new Array();
                            $.each(data, function (i, n) {
                                array.push([n["name"], n["value"]]);
                            });
                            return array;
                        }
                    }, {
                        name: "customerCom",
                        label: "客户公司",
                        type: "dropdown",
                        dropdownType: "ajax",
                        url: "<s:url value='/order-dropdown/cusCompanyByKey'/>",
                        op: "eq",
                        minLength: 1,
                        keyWordName: "key",
                        success: function (data) {
                            data = data.results;
                            var array = new Array();
                            $.each(data, function (i, n) {
                                array.push([n["name"], n["value"]]);
                            });
                            return array;
                        }
                    }, {
                        index: "verifyTimeAfter",
                        name: "verifyTimeAfter",
                        label: "查验时间从",
                        type: "date"
                    }, {
                        index: "verifyTimeBefore",
                        name: "verifyTimeBefore",
                        label: "查验时间至",
                        type: "date"
                    }, {
                        name: "notPassReason",
                        label: "不通过原因",
                        type: "dropdown",
                        dropdownType: "ajax",
                        url: "<s:url value='/order-dropdown/noPassReasonByKey'/>",
                        op: "eq",
                        minLength: 0,
                        keyWordName: "key",
                        success: function (data) {
                            data = data.results;
                            var array = new Array();
                            $.each(data, function (i, n) {
                                array.push([n["name"], n["value"]]);
                            });
                            return array;
                        }
                    }
                ],
                buttons: {
                    custom: [
                        {
                            id: "exportBtn",
                            value: "导出",
                            click: function () {
                                var supplier = $("input[name='supplier']").val();
                                var customerCom = $("input[name='customerCom']").val();
                                var verifyTimeAfter = $("input[name='verifyTimeAfter']").val();
                                var verifyTimeBefore = $("input[name='verifyTimeBefore']").val();
                                var notPassReason = $("input[name='notPassReason']").val();
                                location.href =
                                    "http://219.130.222.62:7080/report/ReportServer?reportlet=gtimp_test/查验不通过统计.cpt&supplier＝"
                                    + supplier + "&customerCom=" + customerCom + "&verifyTimeAfter="
                                    + verifyTimeAfter + "&verifyTimeBefore=" + verifyTimeBefore
                                    + "&notPassReason=" + notPassReason;
                            }
                        }]
                },
                grid: {
                    id: "dictionaryDataGrid",
                    title: "查询结果",
                    url: "count/notPassVerify/search",
                    multiselect: false,
                    colModel: [
                        {
                            index: "ROW_ID",
                            name: "ROW_ID",
                            hidden: true
                        },
                        {
                            index: "SUPPLIER_NAME",
                            name: "SUPPLIER_NAME",
                            label: "供应商"
                        }, {
                            index: "CUSTOMERCOM_NAME",
                            name: "CUSTOMERCOM_NAME",
                            label: "客户公司"
                        }, {
                            index: "CREATE_TIME",
                            name: "CREATE_TIME",
                            label: "查验时间"
                        }, {
                            index: "NO_PASS_REASON",
                            name: "NO_PASS_REASON",
                            label: "查验不通过原因"
                        }, {
                            index: "CHECK_DEPT",
                            name: "CHECK_DEPT",
                            label: "查验单位"
                        }, {
                            index: "CHECK_ITEM",
                            name: "CHECK_ITEM",
                            label: "查验项目"
                        }, {
                            index: "CHECK_GOODS",
                            name: "CHECK_GOODS",
                            label: "查验货物"
                        }, {
                            index: "SNO",
                            name: "SNO",
                            label: "报关单号"
                        }, {
                            index: "CONTAINER_NO",
                            name: "CONTAINER_NO",
                            label: "柜号"
                        }],
                    sortname: "CREATE_TIME",
                    sortorder: "desc"
                }
            }
            ;
        $(document).ready(function () {
            $("#dictionaryDataTable").mrdForm(formSetting);
            $("backBtn").hide();
        });
    </script>
</head>
<body>
<div id="dictionaryDataTable"></div>
</body>
</html>
